package demo02

import demo01.Student

/**
 * @author xiaoZhao
 * @date 2022/6/16
 * @describe 变量和常量
 */
object Test01_Variable {
  def main(args: Array[String]): Unit = {
    //声明变量
    var a: Int = 10;

    var a1 = 10;
    val b1:Int = 22;

    var a2 = 25;
    //    a2="hello"

//    var a3: Int

    a2 =22;
//    b1=22;

    var xiaoli=new Student("xiaoli",22)
    xiaoli =new Student("xiaoli",23)

//    val xiaohong=new Student("xaohong",22)
//    xiaohong=new Student("xiaohong",21)

  var xiaowang=new Student("xiaoli",22)
    xiaowang.age=21
   xiaowang.printInfo()

  }
}
